<!--
_______________________________________________________________________________
* Created by: ppodila
* Date: 11/28/2006
_______________________________________________________________________________
-->
<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Controls="clr-namespace:FluidKit.Controls"
    >

	<ImageBrush x:Key="BrushedMetalBackground"
							ImageSource="images/metal.jpg"
							TileMode="Tile"
							ViewportUnits="Absolute"
							Viewport="0,0,64,64"/>

	<LinearGradientBrush x:Key="WindowBackground"
											 StartPoint="0,0.5"
											 EndPoint="1,0.5"
											 Opacity="0.35">
		<GradientStop Color="Gray"
									Offset="0"/>
		<GradientStop Color="Gainsboro"
									Offset="0.35"/>
		<GradientStop Color="Gainsboro"
									Offset="0.75"/>
		<GradientStop Color="Gray"
									Offset="1"/>
	</LinearGradientBrush>

	<!--
_______________________________________________________________________________
		Close Button Style 
_______________________________________________________________________________
	-->
	<Style x:Key="CloseButtonStyle"
				 TargetType="{x:Type Controls:ImageButton}">
		<Setter Property="NormalImage"
						Value="images/osx_close.png"/>
		<Setter Property="HoverImage"
						Value="images/osx_close_hovered.png"/>
		<Setter Property="PressedImage"
						Value="images/osx_close_pressed.png"/>
	</Style>

	<!--
_______________________________________________________________________________
		Minimize Button Style
_______________________________________________________________________________
	-->
	<Style x:Key="MinimizeButtonStyle"
				 TargetType="{x:Type Controls:ImageButton}">
		<Setter Property="NormalImage"
						Value="images/osx_min.png"/>
		<Setter Property="HoverImage"
						Value="images/osx_min_hovered.png"/>
		<Setter Property="PressedImage"
						Value="images/osx_min_pressed.png"/>
	</Style>

	<!--
_______________________________________________________________________________
		Maximize Button Style 
_______________________________________________________________________________
	-->
	<Style x:Key="MaximizeButtonStyle"
				 TargetType="{x:Type Controls:ImageButton}">
		<Setter Property="NormalImage"
						Value="images/osx_max.png"/>
		<Setter Property="HoverImage"
						Value="images/osx_max_hovered.png"/>
		<Setter Property="PressedImage"
						Value="images/osx_max_pressed.png"/>
	</Style>

	<!--
_______________________________________________________________________________
		GlassWindow template 
_______________________________________________________________________________
	-->
	<ControlTemplate x:Key="GlassWindow_Template"
									 TargetType="{x:Type Controls:GlassWindow}">
		<Grid x:Name="PART_WindowContainer">
			<Border Margin="0,0,0,0"
							BorderBrush="Gainsboro"
							CornerRadius="5,5,5,5"
							BorderThickness="1,1,1,1"
							Background="{StaticResource BrushedMetalBackground}">
				<Border Margin="0,0,0,0"
								CornerRadius="8,8,0,0"
								Background="{StaticResource WindowBackground}">

					<Grid x:Name="ContentGrid"
								Margin="5,5,5,5">
						<Grid.ColumnDefinitions>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="20"/>
							<RowDefinition Height="*"/>
						</Grid.RowDefinitions>

						<Grid Width="Auto"
									Height="Auto"
									x:Name="PART_TitleBar"
									Background="Transparent"
									Grid.Row="0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition/>
							</Grid.RowDefinitions>

							<!-- Title -->
							<TextBlock HorizontalAlignment="Center"
												 VerticalAlignment="Top"
												 Height="Auto"
												 Grid.Column="0"
												 Grid.ColumnSpan="2"
												 Text="{TemplateBinding Title}"
												 FontSize="{x:Static SystemFonts.CaptionFontSize}"
												 FontWeight="{x:Static SystemFonts.CaptionFontWeight}"
												 FontFamily="{x:Static SystemFonts.CaptionFontFamily}" />

							<!-- Close/Min/Max Buttons -->
							<StackPanel HorizontalAlignment="Left"
													VerticalAlignment="Top"
													Margin="0,0,0,0"
													Height="16"
													x:Name="StackPanel"
													Orientation="Horizontal"
											>
								<Controls:ImageButton x:Name="PART_CloseButton"
																	 Style="{StaticResource CloseButtonStyle}"
																	 Margin="0,0,5,0"
																	 />

								<Controls:ImageButton x:Name="PART_MinimizeButton"
																	 Style="{StaticResource MinimizeButtonStyle}"
																	 Margin="0,0,5,0"/>

								<Controls:ImageButton x:Name="PART_MaximizeButton"
																	 Style="{StaticResource MaximizeButtonStyle}"
																	 Margin="0,0,5,0"/>

							</StackPanel>
						</Grid>

						<!-- Window Contents -->
						<AdornerDecorator ClipToBounds="True"
															Grid.Row="1"
															Margin="0,0,0,0">
							<ContentPresenter x:Name="ContentPresenter"
																Content="{TemplateBinding ContentControl.Content}"
																ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
																Width="Auto"
																Height="Auto" />
						</AdornerDecorator>
					</Grid>
				</Border>
			</Border>

			<!-- Resizer Grid -->
			<Grid VerticalAlignment="Stretch"
						Margin="0,0,0,0"
						Height="Auto"
						x:Name="ResizerGrid">
				<Grid.ColumnDefinitions>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition/>
				</Grid.RowDefinitions>
				<Path StrokeThickness="2"
							Stroke="Transparent"
							HorizontalAlignment="Left"
							VerticalAlignment="Stretch"
							x:Name="PART_WResizer"
							Cursor="SizeWE"
							Stretch="Fill"
							Data="M20,87 L20,327.05208" />
				<Path StrokeThickness="2"
							Stroke="Transparent"
							HorizontalAlignment="Right"
							VerticalAlignment="Stretch"
							x:Name="PART_EResizer"
							Cursor="SizeWE"
							Stretch="Fill"
							Data="M20,87 L20,327.05208" />
				<Path StrokeThickness="2"
							Stroke="Transparent"
							HorizontalAlignment="Stretch"
							VerticalAlignment="Bottom"
							x:Name="PART_SResizer"
							Cursor="SizeNS"
							Stretch="Fill"
							Data="M86,180 L343.01751,180" />
				<Path StrokeThickness="2"
							Stroke="Transparent"
							HorizontalAlignment="Stretch"
							VerticalAlignment="Top"
							x:Name="PART_NResizer"
							Cursor="SizeNS"
							Stretch="Fill"
							Data="M86,180 L343.01751,180" />
				<Rectangle Fill="Transparent"
									 HorizontalAlignment="Left"
									 VerticalAlignment="Top"
									 Width="5"
									 Height="5"
									 x:Name="PART_NWResizer"
									 Cursor="SizeNWSE"/>
				<Rectangle Fill="Transparent"
									 HorizontalAlignment="Right"
									 VerticalAlignment="Top"
									 Width="5"
									 Height="5"
									 x:Name="PART_NEResizer"
									 Cursor="SizeNESW"/>
				<Rectangle Fill="Transparent"
									 HorizontalAlignment="Right"
									 VerticalAlignment="Bottom"
									 Width="5"
									 Height="5"
									 x:Name="PART_SEResizer"
									 Cursor="SizeNWSE"/>
				<Rectangle Fill="Transparent"
									 HorizontalAlignment="Left"
									 VerticalAlignment="Bottom"
									 Width="5"
									 Height="5"
									 x:Name="PART_SWResizer"
									 Cursor="SizeNESW"/>
			</Grid>
		</Grid>
	</ControlTemplate>

	<!--
_______________________________________________________________________________
	GlassWindow generic style. This is the entry point 
_______________________________________________________________________________
	-->
	<Style x:Key="MacOSXWindowStyle"
				 TargetType="{x:Type Controls:GlassWindow}">
		<Setter Property="AllowsTransparency"
						Value="True"/>
		<Setter Property="WindowStyle"
						Value="None"/>
		<Setter Property="ResizeMode"
						Value="CanResize"/>
		<Setter Property="Template"
						Value="{StaticResource GlassWindow_Template}"/>
	</Style>
</ResourceDictionary>
